package router

import (
	platformController "gitee.com/wangshh_123/cross-pay-go/src/controller/platform"
	"gitee.com/wangshh_123/cross-pay-go/src/database"
	"gitee.com/wangshh_123/cross-pay-go/src/middleware"
	"gitee.com/wangshh_123/cross-pay-go/src/platform/providers/hlPay"
	"gitee.com/wangshh_123/cross-pay-go/src/platform/providers/photonpay"

	"github.com/gin-gonic/gin"
)

// SetupCardListRouter 设置统一卡列表路由
func SetupCardListRouter(api *gin.RouterGroup, photonPayClient *photonpay.PhotonPayClient, hlpayClient *hlPay.HlPayClient) {
	// 创建统一的卡列表控制器实例
	cardListController := platformController.NewCardListController(photonPayClient, hlpayClient, database.DB)

	// 卡列表路由组
	cardList := api.Group("/card-list")
	cardList.Use(middleware.AuthMiddleware(), middleware.PlatformInfoMiddleware())
	{
		// 基础卡列表查询 - 根据用户平台自动选择
		cardList.GET("/list", cardListController.GetCardList)

		// 根据指定平台获取卡列表
		cardList.GET("/platform/:platform", cardListController.GetCardListByPlatform)

		// 获取两个平台的卡列表对比
		cardList.GET("/comparison", cardListController.GetCardListComparison)

		// 获取支持的平台列表
		cardList.GET("/platforms", cardListController.GetSupportedPlatforms)

		// 获取卡状态选项
		cardList.GET("/status-options", cardListController.GetCardStatusOptions)
	}
}
